import grails.converters.JSON
class StudentAjaxController {

    def index = { }
    def validLoginName = {
        log.info (School.count())
        if(Student.countByUsernameAndSchool(params.name,School.get(params.school)) > 0){
            return render(['success':'1','message' : '<font color="green"> 此登录名已被使用！</font>'] as JSON) 
        }else{
            return render(['success':'1','message' : '此登录名可用！'] as JSON) 
        }        
    }
}
